// app.js
App({
  globalData: {
    userInfo: null,
    openid: '',
    cloudConfig: {
      env: 'prod-1gfevf5297a6d54a', // 环境 ID
      service: 'thinkphp-nginx-0hrc' // 服务名
    }
  },

  onLaunch() {
    wx.cloud.init({
      env: this.globalData.cloudConfig.env,
      traceUser: true
    });
  },

  getOpenid() {
    return this.globalData.openid;
  },
  getCloudConfig() {
    return this.globalData.cloudConfig;
  }
});